<template>
  <div>
    <div class="login-container">
      <!-- ref 相当于 id，:model 表单数据对象, label-width 表单域标签的的宽度 -->
      <el-form ref="form" label-width="80px" class="login-form">
        <h2 class="login-title">金丰会员管理系统-登录</h2>
        <el-form-item label="帐号">
          <el-input placeholder="请输入帐号" v-model="username"></el-input>
        </el-form-item>
        <el-form-item label="密码">
          <el-input type="password" placeholder="请输入密码"> </el-input>
        </el-form-item>
        <el-form-item>
          <el-button type="primary" @click="go">注册</el-button>
          <el-button type="primary">登录</el-button>
        </el-form-item>
      </el-form>
    </div>
  </div>
</template>

<script>
export default {
  name: "login",
  data() {
    return {
      username: "",
    };
  },

  components: {},

  methods: {
    go() {
      this.$router.push("/reg");
    },
  },

  created() {
    console.log(this.$route);
    this.username = this.$route.query.username;
  },
};
</script>

<style scoped>
.login-form {
  width: 350px;
  /* 上下间隙150px, 左右自动 */
  margin: 160px auto;
  /*透明背景色*/
  background-color: rgb(255, 255, 255, 0.8);
  padding: 30px;
  /* 圆角 */
  border-radius: 20px;
}
.login-container {
  position: absolute;
  width: 100%;
  height: 100%;
  background: url("../../assets/img/login.jpg");
  overflow: hidden;
}
/* 标题 */
.login-title {
  text-align: center;
  color: #303133;
}
</style>
